<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>DOM</title>
    <!-- <script>
		function changetext(id) {
   		 id.innerHTML = "thanks!";
		}
	</script> -->
</head>

<body>
    <!-- <h1 onclick="changetext(this)">请点击该文本</h1> -->
    <p>点击按钮就可以执行 <em>displayDate()</em> 函数。</p>
    <button id="myBtn">dianji点击</button>
    <p id="demo"></p>

    <script>
    	document.getElementById("myBtn").onclick = function (){
    		displayDate();
    	}
    	function displayDate () {
    		document.getElementById("demo").innerHTML = Date();
    	}
    	
    </script>
</body>

</html>